/**
 * 使用vue插件注册全局组件
 * 语法：
 * install方法参数变化了
 * vue2: {install(Vue){}} => Vue构造函数
 * vue3: {install(app){}} => app实例
 */

import Skeleton from './Skeleton'
import Slider from './Slider'
import More from './More'
import Bread from './Bread/index.vue'
import BreadItem from './Bread/item.vue'
import City from './City'
import Sku from './Sku'
import Numbox from './Numbox'
import Button from './Button'
import CheckBox from './CheckBox'

const cps = [Skeleton, CheckBox, Button, Numbox, Sku, Slider, More, Bread, BreadItem, City]

export default {
  install (app) {
    // console.log('vue实例：', app)
    // 批量注册
    cps.forEach(cp => {
      app.component(cp.name, cp)
    })
  }
}
